package com.example.mysql.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hello")
public class DemoController {

    @Value("${test.key:default}")
    private String key;

    @GetMapping("/get")
    public String get() {
        return "Get";
    }

    @PostMapping("/post")
    public String post() {
        return "Post";
    }

    @GetMapping("/value")
    public String value() {
        return key;
    }
}
